<template>
  <div class="container">
    <h3 class="title">体检</h3>
    <el-form :model="loginForm" class="login-form">
      <el-form-item>
        <el-input prefix-icon="UserFilled" v-model="loginForm.docCode" />
      </el-form-item>

      <el-form-item >
        <el-input prefix-icon="Key" type="password" v-model="loginForm.password" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" style="width: 100%;" @click="handleLogin">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import request from "@/request/request";
import qs from "qs"
export default {
  name: "Login",
  data(){
    return {
      loginForm:{
        docCode:"zzj",
        password:"123"
      }
    }
  },

  methods:{
    handleLogin(){
      this.$router.replace({"path":"/book/list"});
      // request({
      //   method:"post",
      //   url:"doctors/login",
      //   data: qs.stringify(this.loginForm)
      // }).then((respData)=>{
      //    if(respData.code == 200){
      //
      //      //保存到vuex
      //      this.$router.replace({"path":"/book/list"});
      //      //保存到sessionStorage
      //      sessionStorage.setItem("doctorInfo",JSON.stringify(respData.data));
      //      sessionStorage.setItem("token",respData.msg);
      //      this.$store.commit("setDoctorInfo",respData.data);
      //    }
      // })
    }
  }
}
</script>

<style scoped>
    .container{
      padding-top: 160px;

      width: 100%;
      height:100%;
      box-sizing: border-box;
      background-image: url("./../assets/bg_login.jpeg");
      background-repeat: no-repeat;
    }

    .container .title{
      font-size: 30px;
      color: #fff;
      margin: 0px auto 40px auto;
      text-align: center;
      font-weight: 500;
    }

    .login-form{
      position: relative;
      width: 400px;
      max-width: 100%;
      margin: 0 auto;
      overflow: hidden;
    }

</style>